package com.dries.chat.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.dries.chat.entity.ChatMsg;
import com.dries.chat.vo.ChatMsgVo;
import com.dries.chat.vo.DataContent;
import io.netty.channel.Channel;
import io.netty.channel.group.ChannelGroup;

import java.util.List;

/**
 * 
 *
 * @author dries
 * @email samphsanie@gmail.com
 * @date 2020-08-10 14:36:09
 */
public interface IChatMsgService extends IService<ChatMsg> {
    /**
     * 保存聊天消息到数据库
     * @param chat
     * @return
     */
    String saveMsg(ChatMsgVo chat);

    /**
     * 批量签收消息
     * @param msgIdsList
     */
    void updateMsgSigned(List<String> msgIdsList);

    /**
     * 发送通知消息（提示）
     * @param channelGroup
     * @param channel
     */
    void sendAddNotify(ChannelGroup channelGroup, Channel channel);

    void sendRemoveNotify(ChannelGroup channelGroup, Channel channel);

    void sendNotify(ChannelGroup channelGroup, DataContent dataContent, Channel channel);

    void sendMessage(ChannelGroup channelGroup, Channel channel, DataContent dataContent);

    void sendGroupMessage(ChannelGroup channelGroup, Channel channel, DataContent dataContent);
}

